package com.ymatou.iapi.notify.testcase;

import com.ymatou.iapi.notify.parameter.SendSpeedNotifyBean;
import com.ymatou.iapi.notify.parameter.SendSpeedNotifyByUserIdBean;
import com.ymatou.iapi.notify.service.SendSpeedNotifyByUserIdCall;
import com.ymatou.iapi.userregister.parameter.UserRegisterInfoRequestDtoBean;
import com.ymatou.iapi.userregister.service.UserRegisterInfoRequestDtoCall;
import com.ymttest.business.service.JUserCallService;
import com.ymttest.business.service.NotifyCallService;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;

import java.util.ArrayList;
import java.util.Arrays;

/**
*根据批量通知ID和用户列表发通知
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_SendSpeedNotifyByUserId{
	private static SendSpeedNotifyByUserIdBean sendspeednotifybyuseridBean;
	private static SendSpeedNotifyByUserIdCall sendspeednotifybyuseridCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据批量通知ID和用户列表发通知");
	}

	@Before
	public void caseUp() {
		sendspeednotifybyuseridBean=new SendSpeedNotifyByUserIdBean();
		sendspeednotifybyuseridCall=new SendSpeedNotifyByUserIdCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(sendspeednotifybyuseridCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_SendSpeedNotifyByUserId_01() {
		Logger.start(true,"根据批量通知ID和用户列表发通知");
		try {
			UserRegisterInfoRequestDtoBean regbean1 = JUserCallService.initUserRegisterInfoRequestDtoBean();
			UserRegisterInfoRequestDtoBean regbean2 = JUserCallService.initUserRegisterInfoRequestDtoBean();
			UserRegisterInfoRequestDtoCall urrc1 = JUserCallService.UserRegisterInfoRequestDtoCall(regbean1);
			UserRegisterInfoRequestDtoCall urrc2 = JUserCallService.UserRegisterInfoRequestDtoCall(regbean2);
			Integer userId1 = urrc1.getUserid();
			Integer userId2 = urrc2.getUserid();
			SendSpeedNotifyBean sendNotifyBean = NotifyCallService.initSendSpeedNotify(30156393);
			int notifyId = NotifyCallService.SendSpeedNotify(sendNotifyBean);
			sendspeednotifybyuseridBean.setNotifyId(notifyId);
			int[] UserIds = {userId1,userId2};
			sendspeednotifybyuseridBean.setUserIds(UserIds);
			sendspeednotifybyuseridCall.setData(sendspeednotifybyuseridBean);
			sendspeednotifybyuseridCall.callService();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}